package com.ruoyi.web.controller.ring.app;

import com.alibaba.fastjson2.JSON;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.ring.domain.ActionRecord;
import com.ruoyi.ring.service.IActionRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 行动 （APP）
 */
@Slf4j
@RestController
@RequestMapping("/ring/app/action_record")
public class AppActionRecordController extends BaseController
{
    @Resource
    private IActionRecordService actionRecordService;

    /**
     * 查询行动列表-app
     */
    @GetMapping("/query-list")
    public AjaxResult queryList(ActionRecord actionRecord) {
        long userId = SecurityUtils.getUserId();
        log.info("行动列表queryList: userId={}, param={}", userId, JSON.toJSONString(actionRecord));
        List<ActionRecord> list = actionRecordService.selectActionRecordList(actionRecord);
        return AjaxResult.success(list);
    }
}
